<?php if (!defined('BASEPATH'))exit('No direct script access allowed');
/**
 * 广告控制器
 */
class Ads extends MY_Controller {

    function __construct() {
        parent::__construct();
    }
    //首页
    function index() {
        
        //推荐贷款平台
        $lend_list = $this->db->query("select id,logo_list,name_ch,amount_area_alisa,rate,tip_list,h5_reg_url from tan_lend_list where status = 1 order by is_recommand desc,sort desc,id desc")->result_array();
        foreach ($lend_list as  $key =>$val){
               $rate = ($val['rate'] * 100);
               $lend_list[$key]['rate'] =  !strpos($rate,".") ? sprintf("%01.2f",$rate)."%" : (strlen((explode(".",$rate)[1])) != 3 ? sprintf("%01.2f",$rate)."%" : $rate."%");
        }
        $this->assign("lend_list", $lend_list);
        $this->display('ads/index.html');
    }
    
}